<template>
    <button @click="toParent">点击向父组件传递数据</button>
</template>

<script setup>
import { defineEmits } from 'vue';

const emit = defineEmits(['getMsg'])

function toParent () {
    emit('getMsg', 10086)
}
</script>